package cn.easy.mortgage.utils;

import freemarker.template.Configuration;
import cn.easy.mobile.utils.Constants;
import java.util.Collections;
import java.util.HashMap;
import java.util.Map;

public class SmsUtils {
    public static Configuration config;
    public static final Map<String, Object> CODE_MAP = Collections.synchronizedMap(new HashMap());

    public static Boolean checkSafe(String mobile) {
        Map varPool = (Map) CODE_MAP.get(mobile);
        if (varPool == null) {
            return true;
        }
        Integer codeCount = (int) varPool.get(Constants.CODE_GET_COUNT);
        long addTime = (Long) varPool.get(Constants.ADD_TIME);
        if (codeCount > 5 && System.currentTimeMillis() - addTime < 600000L){
            return false;
        }
        return true;
    }
}
